package homework;
import java.util.Scanner;
public class test4 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.print("请输入税前工资：");
        int grossPay = scan.nextInt();
        //三险一金为总工资的10%
        if (0.9 * grossPay > 0 && grossPay * 0.9 <= 5000) {
            System.out.println("税后工资为："+grossPay);
        } else if (grossPay * 0.9 >= 5000) {
            if (grossPay * 0.9 - 5000 >= 0 && grossPay * 0.9 - 5000 < 3000) {
                System.out.println("税后工资为：" + (grossPay*0.9 - (grossPay * 0.9 - 5000) * 0.03));
            } else if (grossPay * 0.9 - 5000 >= 3000 && grossPay * 0.9 - 5000 < 12000) {
                System.out.println("税后工资为：" + (grossPay * 0.9 - 0.03 * 3000 - (grossPay * 0.9 - 5000 - 3000) * 0.1));
            }else if(grossPay * 0.9 - 5000 >= 12000 && grossPay * 0.9 - 5000 < 25000){
                System.out.println("税后工资为：" + (grossPay*0.9 - 0.03 * 3000- 0.1 * 9000-(grossPay* 0.9-5000 - 12000) * 0.2));
            } else if (grossPay * 0.9 - 5000 >= 25000 && grossPay * 0.9 - 5000 < 35000) {
                System.out.println("税后工资为：" + (grossPay*0.9 - 0.03 * 3000 - 0.1 * 9000 -13000*0.2- (grossPay* 0.9-5000 - 25000) * 0.25));
            } else if (grossPay * 0.9 - 5000 >= 35000 && grossPay * 0.9 - 5000 < 55000) {
                System.out.println("税后工资为：" + (grossPay*0.9 - 0.03 * 3000 - 0.1 * 9000 -13000*0.2- 0.25 * 10000 - (grossPay* 0.9-5000 - 35000) * 0.3));
            } else if (grossPay * 0.9 - 5000 >= 55000 && grossPay * 0.9 - 5000 < 80000) {
                System.out.println("税后工资为：" + (grossPay*0.9 - 0.03 * 3000 - 0.1 * 9000 -13000*0.2- 0.25 * 10000 - 0.3 * 20000 - (grossPay* 0.9-5000 - 55000) * 0.35));
            } else if (grossPay * 0.9 - 5000 > 80000) {
                System.out.println("税后工资为：" + (grossPay*0.9 - 0.03 * 3000 - 0.1 * 9000 -13000*0.2- 0.25 * 10000 - 0.3 * 20000 - 0.35 * 25000 - (grossPay* 0.9-5000 - 80000) * 0.45));
            } else {
                System.out.println("输入有误");
            }

        } else {
            System.out.println("输入有误");
        }
    }
}
